package com.company.cloud.captcha.modules.api.fallback;

import com.company.cloud.captcha.modules.api.model.CaptchaVO;
import com.company.cloud.captcha.modules.api.service.CaptchaRemoteService;
import com.company.cloud.common.bean.BaseClientResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

@Log4j2
@Component
public class CaptchaRemoteServiceFallbackFactory implements FallbackFactory<CaptchaRemoteService>{

	@Override
	public CaptchaRemoteService create(Throwable cause) {
		return new CaptchaRemoteService() {

			@Override
			public BaseClientResult<CaptchaVO> check(CaptchaVO captchaVO) {
				return BaseClientResult.callbackError();
			}
		};
	}

}
